package com.oa.service.impl;

import com.oa.mapper.RoleMenuMapper;
import com.oa.pojo.RoleMenu;
import com.oa.service.RoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author wsrwy
* @description 针对表【role_menu】的数据库操作Service实现
* @createDate 2023-10-22 20:53:26
*/
@Service
public class RoleMenuServiceImpl implements RoleMenuService{
    @Autowired
    private RoleMenuMapper roleMenuMapper;
    @Override
    public List<RoleMenu> selectRoleMenu(Integer id,Integer roleId,Integer menuId) {
        RoleMenu roleMenu = new RoleMenu();
        roleMenu.setRoleId(roleId);
        roleMenu.setMenuId(menuId);
        roleMenu.setId(id);
        List<RoleMenu> roleMenuList = roleMenuMapper.selectAll(roleMenu);
        return roleMenuList;
    }
    @Override
    public int deleteRoleMenu(Integer id) {
        RoleMenu roleMenu = new RoleMenu();
        roleMenu.setId(id);
        return roleMenuMapper.deleteRoleMenu(roleMenu);
    }
    @Override
    public int insertRoleMenu(RoleMenu roleMenu) {
        return roleMenuMapper.insertRoleMenu(roleMenu);
    }

    @Override
    public int updateRoleMenu(RoleMenu roleMenu) {
        return roleMenuMapper.updateRoleMenu(roleMenu);
    }
}




